#ifndef _THREADPOOL_H
#define _THREADPOOL_H

#include <stdlib.h>
#include <pthread.h>
#include "poolqueue.h"

// 线程池结构体
typedef struct ThreadPool
{
    pthread_t *workers;   // 工作的线程
    TaskQueue* taskqueue;
}ThreadPool;

ThreadPool* createThreadPool(int worker_number,int queuesize);
void destroyThreadPool(ThreadPool* threadpool);
void ThreadPollPostTask(ThreadPool* threadpool,Task *task);

#endif  // _THREADPOOL_H